<?php
/**
 * EDIT FORM View Helper
*/
class Zend_View_Helper_EditFormRight extends Zend_View_Helper_Abstract
{
    protected $_form;
    

    protected $_city;
    protected $_country;
    protected $_region;
    protected $_priority;
    
    public function editFormRight($form)
    {
        $this->_form = $form;
        return $this;
    }
   
    public function editCountry()
    {
    	$this->_country =
    		'<div class="form-item">
				<label for="status">Country</label>
				<div class="field-wrapper">
					'.$this->_form->countryid.'
				</div>
				<div class="clear" ></div>
			</div>';
    	return $this;
    }
    public function editRegion()
    {
        $this->_region =
	        '<div class="form-item">
		        <label for="status">Region</label>
		        <div class="field-wrapper">
		        	'.$this->_form->regionid.'
		        </div>
		        <div class="clear" ></div>
	        </div>';
        return $this;
    }
    public function editCity()
    {
        $this->_city =
	        '<div class="form-item">
		        <label for="status">City</label>
		        <div class="field-wrapper">
		        	'.$this->_form->cityid.'
		        </div>
		        <div class="clear" ></div>
	        </div>';
        return $this;
    }
    public function editPriority()
    {
    	$this->_priority = 
    	'<div class="form-item">
			<label for="status">Priority</label>
			<div class="field-wrapper">
				'.$this->_form->priority.'	
				<div class="clear" ></div>
			</div>
		</div>';
    	return $this;
    }
    
    public function toString()
    {
        $xhtml='<div class="detail-infomation-right" >
					<fieldset class="form-aside" >'.$this->langTab('small').
						'<fieldset class="form-group-right" >
							<legend>Publish</legend>
							<div class="form-item">				
								<label for="status">Status</label>
								<div class="field-wrapper">
									<div style="float:left;">
									<span id="status_1" class="on" >Status </span>
									</div>
								</div>
								<div class="clear" ></div>
							</div>'.
							$this->_priority
							.'<div style="display: none;" >
								<div id="content_properties" >
									'.$this->_form->status.'	
								</div>
							</div>
						</fieldset>'.
						'<fieldset class="form-group-right" >
							<legend>Location</legend>'.
							$this->_country.$this->_region.$this->_city.
						'</fieldset>
					</fieldset>
				</div>	
			</form>';
    	return $xhtml;
    }
    
    private function langTab($style)
    {
        $xhtml = '<div id="lang_indicator" class="'.$style.'">'."\n";
        $xhtml .= '<span id="btn_flag_vi" class="btn_flag"></span>'."\n";
        $xhtml .= '<span id="btn_flag_en" class="btn_flag"></span>'."\n";
        $xhtml .= '<span id="btn_flag_ja" class="btn_flag"></span>'."\n";
        $xhtml .= '<span id="btn_flag_zh" class="btn_flag"></span>'."\n";
        $xhtml .= '<span id="btn_flag_fr" class="btn_flag"></span>'."\n";
        $xhtml .= '</div>'."\n";
        
        return $xhtml;
    }
    
}
?>